package com.wyc.serviceMap.service.impl;

import com.wyc.internalCommon.response.TerminalResponse;
import com.wyc.internalCommon.response.TrSearchResponse;
import com.wyc.internalCommon.result.ApiResult;
import com.wyc.serviceMap.remote.TerminalClient;
import com.wyc.serviceMap.service.TerminalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TerminalServiceImpl implements TerminalService {

    @Autowired
    private TerminalClient terminalClient;

    /**
     * 添加终端
     * @param name
     * @return
     */
    @Override
    public ApiResult add(String name,String carId) {
        return terminalClient.add(name,carId);
    }

    /**
     * 搜索周边终端
     * @param center
     * @param radius
     * @return
     */
    @Override
    public ApiResult<List<TerminalResponse>> aroundSearch(String center, Integer radius) {
        return terminalClient.aroundSearch(center,radius);
    }

    /**
     * 查询轨迹信息
     * @param tid
     * @param starttime
     * @param endtime
     * @return
     */
    @Override
    public ApiResult<TrSearchResponse> trsearch(String tid, Long starttime, Long endtime) {
        return terminalClient.trsearch(tid,starttime,endtime);
    }
}
